import { openBlock as d, createElementBlock as a, normalizeClass as f, renderSlot as c, createTextVNode as p, normalizeStyle as l, createElementVNode as g } from "vue";
const u = {
  __name: "button",
  props: {
    size: {
      typeof: String,
      default: "small"
    }
  },
  setup(t) {
    return (n, e) => (d(), a("button", {
      class: f([`pt-btn-${t.size}`])
    }, [
      c(n.$slots, "default", {}, () => [
        p("按钮")
      ])
    ], 2));
  }
}, v = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: u
}, Symbol.toStringTag, { value: "Module" }));
const x = (t, n) => {
  const e = t.__vccOpts || t;
  for (const [s, o] of n)
    e[s] = o;
  return e;
}, h = {
  props: {
    textColor: {
      type: String,
      default: "#666"
    },
    textBgColor: {
      type: String,
      default: "#fff"
    },
    lineColor: {
      type: String,
      default: "#ddd"
    },
    lineWidth: {
      type: Number,
      default: 1
    },
    position: {
      type: String,
      default: "center",
      validator(t) {
        return ["left", "center", "right"].includes(t);
      }
    }
  },
  data() {
    return {
      start: 0,
      end: 0
    };
  },
  mounted() {
    this.setPosition();
  },
  updated() {
    this.setPosition();
  },
  methods: {
    setPosition() {
      let t = this.$refs.dividerText.offsetWidth, n = "30px";
      this.position === "left" ? (this.start = n, this.end = `calc(${n} + ${t}px)`) : this.position === "center" ? (t = t / 2, this.start = `calc(50% - ${t}px)`, this.end = `calc(50% + ${t}px)`) : this.position === "right" && (this.start = `calc(100% - ${t + 30}px)`, this.end = "calc(100% - 30px)");
    }
  }
};
function m(t, n, e, s, o, b) {
  return d(), a("div", {
    class: "pt-divider",
    style: l({
      backgroundImage: `linear-gradient(to right, ${e.lineColor} ${o.start}, transparent ${o.start} ${o.end}, ${e.lineColor} ${o.end})`,
      backgroundSize: `100% ${e.lineWidth}px`,
      textAlign: e.position
    })
  }, [
    g("span", {
      ref: "dividerText",
      class: "divider-text",
      style: l({ color: e.textColor })
    }, [
      c(t.$slots, "default")
    ], 4)
  ], 4);
}
const _ = /* @__PURE__ */ x(h, [["render", m]]), y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: _
}, Symbol.toStringTag, { value: "Module" }));
const S = {
  install(t) {
    t.component("PtButton", u);
  }
}, w = {
  install(t) {
    t.component("PtDivider", _);
  }
}, r = /* @__PURE__ */ Object.assign({ "./button/button.vue": v, "./divider/divider.vue": y }), i = async (t) => {
  for (const n in r) {
    let e = n.slice(n.lastIndexOf("/") + 1).replace(".vue", "");
    e = e.slice(0, 1).toUpperCase() + e.slice(1), t.component(`Pt${e}`, r[n].default);
  }
};
typeof window < "u" && (window.Vue ? i(window.Vue) : window.peentoUi = i);
const C = {
  install: i
};
export {
  S as Button,
  w as Divider,
  C as default
};
